package com.frxuexi.lib_base.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.frxuexi.lib_base.entity.RepairCommentBean

@Dao
interface CommentDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(repairCommentBean: RepairCommentBean):Long

    @Query("select * from comment where repairId=:repairId order by id desc")
    fun getComments(repairId:Int):List<RepairCommentBean>

    @Delete
    fun deleteComment(repairCommentBean: RepairCommentBean):Int

    @Update
    fun updateComment(repairCommentBean: RepairCommentBean):Int
}